import mediarequest from '@/utils/media-request'
import mediaoldrequest from '@/utils/media-old-request'

// 媒包列表
export function getPackages(data) {
    return mediarequest({
        url: '/packages',
        method: 'get',
        params: data
    })
}
// 媒包添加媒资
export function postMediaToPackage(data) {
    return mediarequest({
        url: '/console/package/rel/medias ',
        method: 'post',
        data: data
    })
}
// 媒包删除媒资
export function delMediaFromPackage(data) {
    return mediarequest({
        url: '/console/package/rel/medias ',
        method: 'delete',
        data: data
    })
}
//媒包详情
export function getPackage(data) {
    return mediarequest({
        url: '/package',
        method: 'get',
        params: data
    })
}
//媒包添加
export function createPackage(data) {
    return mediarequest({
        url: '/console/package',
        method: 'post',
        data
    })
}
//媒包更新
export function updatePackage(data) {
    return mediarequest({
        url: '/console/package',
        method: 'put',
        data
    })
}
//媒包下媒资列表
export function getPackageMedias(data) {
    return mediarequest({
        url: '/console/package/medias',
        method: 'get',
        params: data
    })
}
//媒包下媒资搜索建议接口
export function getSearchSuggest(data){
    return mediaoldrequest({
        url: '/corp/package/media/search/suggest/list',
        method: 'get',
        params: data
    })
}

// 媒包频道列表
export function getPackageChannels(data) {
    return mediarequest({
        url: '/console/package/channels',
        method: 'get',
        params: data
    })
}
// 创建 媒资包频道
export function createPackageChannel(data) {
    return mediarequest({
        url: '/console/package/channel',
        method: 'post',
        data
    })
}
// 编辑媒资包频道
export function updatePackageChannel(data) {
    return mediarequest({
        url: '/console/package/channel',
        method: 'put',
        data
    })
}
// 删除媒资包频道
export function deletePackageChannel(data) {
    return mediarequest({
        url: '/console/package/channel',
        method: 'delete',
        data
    })
}
// 媒包频道栏目列表
export function getPackageChannelColumns(data) {
    return mediarequest({
        url: '/console/package/channel/columns',
        method: 'get',
        params: data
    })
}
// 创建媒资包频道栏目
export function createPackageChannelColumn(data) {
    return mediarequest({
        url: '/console/package/channel/column',
        method: 'post',
        data
    })
}
// 编辑媒资包频道栏目
export function updatePackageChannelColumn(data) {
    return mediarequest({
        url: '/console/package/channel/column',
        method: 'put',
        data
    })
}
// 删除媒资包频道栏目
export function deletePackageChannelColumn(data) {
    return mediarequest({
        url: '/console/package/channel/column',
        method: 'delete',
        data
    })
}
// 媒包频道下媒资列表
export function getPackageChannelMedias(data) {
    return mediarequest({
        url: '/console/package/channel/medias',
        method: 'get',
        params: data
    })
}

// 媒包栏目媒资列表
export function getPackageColumnMedias(data) {
    return mediarequest({
        url: '/console/package/channel/column/rel/medias',
        method: 'get',
        params: data
    })
}

// 媒资包栏目添加媒资
export function columnRelMedia(data) {
    return mediarequest({
        url: '/console/package/channel/column/rel/medias',
        method: 'post',
        data
    })
}

// 媒资包栏目删除媒资
export function deleteColumnRelMedia(data) {
    return mediarequest({
        url: '/console/package/channel/column/rel/medias',
        method: 'delete',
        data
    })
}

// 内容包自动编目
export function updatePackageMediatypes(data) {
    return mediarequest({
        url: '/console/package/rel/mediatypes',
        method: 'put',
        data
    })
}
// 内容包已关联媒体类型
export function getPackageMediatypes(data) {
    return mediarequest({
        url: '/console/package/rel/mediatypes',
        method: 'get',
        params: data
    })
}